package main

import (
	"fmt"
	"yundian/internel/app/logic"
	. "yundian/internel/pkg/dbs"
	. "yundian/internel/pkg/dingo"
	"yundian/internel/pkg/dingo/system"
)

func main() {
	system.New("./configs/alipay.yaml").
		Ready(
			NewZapComponent(),   // logger 日志管理
			NewMysqlComponent(), // mysql 连接
			NewRedisComponent(), // redis 连接
			NewTransComponent(), // validator 翻译器
		)

	//orderInfo := dao.NewOrderDao().WxGetOrderInfoByTradeNo("ZM20230407181727294536").Unwrap().(*orders.OrderModel)
	//fmt.Println(orderInfo)
	//
	//orderLogic := logic.NewAliPayOrderLogic()
	//respData, err := orderLogic.AliPayOrderMessage(orderInfo)
	//fmt.Println("AliPayOrderMessage", respData, err)

	//orderLogic := logic.NewAliPayOrderLogic()
	//respData, err := orderLogic.AliPaySubscribeMessage(orderInfo)
	//fmt.Println("AliPaySubscribeMessage", respData, err)

	//orderLogic := logic.NewAliPayOrderLogic()
	//param := &alipayex.OfflineMaterialImageUploadRes{
	//	ImageType: "jpg",
	//	ImageName: "中曼物联",
	//	ImagePath: "/Users/zhang/Downloads/bg.png",
	//}
	//respData, err := orderLogic.AliPayOfflineMaterialImageUpload(param)
	//fmt.Println("AliPayOfflineMaterialImageUpload", respData, err)

	//orderLogic := logic.NewAliPayOrderLogic()
	//respData, err := orderLogic.AliPayMarketingCardTemplateCreate()
	//fmt.Println("AliPayMarketingCardTemplateCreate", respData, err)

	//orderLogic := logic.NewAliPayOrderLogic()
	//respData, err := orderLogic.AliPayMarketingCardFormTemplateSet()
	//fmt.Println("AliPayMarketingCardFormTemplateSet", respData, err)

	orderLogic := logic.NewAliPayOrderLogic()
	respData, err := orderLogic.AliPayCreditAgreementSign()
	fmt.Println("AliPayCreditAgreementSign", *respData, err)
}
